package com.junittest.code;

import java.util.Calendar;

public class Car {
       
        private String manufacturer;
        private String model;
        private int manufactureYear;
        private int kilometersDriven;
        private int refueledGas;
       
        public Car(String manufacturer, String model, int manufactureYear, int kilometersDriven, int refueledGas)
        {
                this.manufacturer = manufacturer;
                this.model = model;
                this.manufactureYear = manufactureYear;
                this.kilometersDriven = kilometersDriven;
                this.refueledGas = refueledGas;
        }
       
        public String getManufacturerAndModel()
        {
                return this.manufacturer + " " + this.model;
        }
       
        public int getAgeOfCar()
        {
                return Calendar.getInstance().get(Calendar.YEAR) - this.manufactureYear;
        }
       
        public int getConsumption()
        {
                return kilometersDriven / refueledGas;
        }
       
        public int getTotalKilometersDriven()
        {
                return this.kilometersDriven;
        }
       
        public String getAllInformation()
        {
        	return String.format("Manufacturer: " + this.manufacturer + 
        						", Model: " + this.model + 
        						", Year: " + this.manufactureYear + 
        						", Kilometers: " + this.kilometersDriven + 
        						", Gas: " + this.refueledGas);
        }
       
}
